package com.csun.cmny.provider.netty.test;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-10-15 10:07
 * @Description:
 */
@Component
public class TcpChannelHandler extends ChannelInitializer<SocketChannel> {

    @Resource
    private TcpServerHandler tcpServerHandler;

    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        socketChannel.pipeline().addLast(tcpServerHandler);
    }

}
